import express = require("express");
import {Request, Response} from "express";

import PWSApp from "../../core/app";
import AdminBaseAction from "./act.base";
import {RouteType} from "../../core/defines";
import {ErrCode} from "../../core/error.code";

export default class IndexAction extends AdminBaseAction {

    constructor(app: PWSApp){
        super(app);
    }

    name() { return `${this.app.name}IndexAction`; }

    protected _setRoutes() {
        this._setRoot('/admin');
        this._route(RouteType.GET, '/', this._actIndex);
    }

    private _actIndex(req: Request, res: Response) {
        res.send({err_code: ErrCode.Success});
    }
}
